fix(auth): bypass SSO for viewer-context requests#113124
Merged
Conversation
Member
Author
|
Note - this is only for internal requests that already have a form of trust established either via:
To ensure this isn't exploitable from the outside we are also stripping |
9c118d9 to
0b95e42
Compare
Viewer-context authentication is used by Seer code mode callbacks, but the request was treated like a browser session and forced through the SSO gate for SSO-required orgs. Mark viewer-context-authenticated requests explicitly and let them skip only the SSO requirement while keeping normal membership-based access checks intact. Add a regression test covering the SSO-required org path. Co-Authored-By: OpenAI Codex <noreply@openai.com>
0b95e42 to
41923d1
Compare
azulus
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bypass the SSO gate for requests authenticated through viewer context.
Seer code mode callbacks authenticate as the acting user via
X-Viewer-Context, but Sentry was treating those requests like browser-session auth and enforcing completed SSO state from the Django session. That made callbacks fail withsso-requiredfor orgs that require SSO even though the user identity had already been asserted by a trusted first-party service.This marks viewer-context-authenticated requests explicitly and lets them skip only the SSO gate while preserving the existing membership-based access checks. It also adds a regression test covering the SSO-required org path so the Seer callback behavior stays covered.